#include <stdio.h>
int main()
{
    int salary;
    while( scanf("%d", &salary) != EOF ){
        if(salary <= 3500 )
            printf("%d\n", salary);
        else{
            int temp = salary - 3500;
            float tax=0;
            if(temp >= 0 && temp <= 1500)
                tax = temp * 0.03;
            else if( temp > 1500 && temp <= 4500 )
                tax = 1500 * 0.03 + (temp - 1500) * 0.1;
            else if( temp > 4500 && temp <= 9000 )
                tax = 1500 * 0.03 + 3000 * 0.1 + (temp - 4500) * 0.2;
            else if( temp > 9000 && temp <= 35000 )
                tax = 1500 * 0.03 + 3000 * 0.1 + 4500 * 0.2 + (temp - 9000) * 0.25;
            else if( temp > 35000 && temp <= 55000 )
                tax = 1500 * 0.03 + 3000 * 0.1 + 4500 * 0.2 + 26000 * 0.25 + (temp - 35000) * 0.3;
            else if( temp > 55000 && temp <= 80000 )
                tax = 1500 * 0.03 + 3000 * 0.1 + 4500 * 0.2 + 26000 * 0.25 + 20000 * 0.3 + (temp - 55000) * 0.35;
            else
                tax = 1500 * 0.03 + 3000 * 0.1 + 4500 * 0.2 + 26000 * 0.25 + 20000 * 0.3 + 25000 * 0.35 + (temp - 80000) * 0.45;
            printf("%.f\n", salary - tax);
        }
    }
    return 0;
}